<html>
<head><meta charset="utf-8"><title>Talk on data layout · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Talk.20on.20data.20layout.html">Talk on data layout</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="179076027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Talk%20on%20data%20layout/near/179076027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Talk.20on.20data.20layout.html#179076027">(Oct 25 2019 at 18:22)</a>:</h4>
<p>Interesting talk on data layout in OCaml: <a href="https://www.youtube.com/watch?v=RV-4Xddk0Yc" target="_blank" title="https://www.youtube.com/watch?v=RV-4Xddk0Yc">https://www.youtube.com/watch?v=RV-4Xddk0Yc</a><br>
Cc <span class="user-mention" data-user-id="119009">@eddyb</span></p>
<div class="youtube-video message_inline_image"><a data-id="RV-4Xddk0Yc" href="https://www.youtube.com/watch?v=RV-4Xddk0Yc" target="_blank" title="https://www.youtube.com/watch?v=RV-4Xddk0Yc"><img src="https://i.ytimg.com/vi/RV-4Xddk0Yc/default.jpg"></a></div>



<a name="179076093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Talk%20on%20data%20layout/near/179076093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Talk.20on.20data.20layout.html#179076093">(Oct 25 2019 at 18:23)</a>:</h4>
<p>Stephen Dolan <span aria-label="thumbs up" class="emoji emoji-1f44d" role="img" title="thumbs up">:thumbs_up:</span></p>



<a name="179076271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Talk%20on%20data%20layout/near/179076271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Talk.20on.20data.20layout.html#179076271">(Oct 25 2019 at 18:25)</a>:</h4>
<p>(I don't think he has published his caml-oxide rust/ocaml binding paper like he promised us ? :)</p>



<a name="179319364"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Talk%20on%20data%20layout/near/179319364" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Talk.20on.20data.20layout.html#179319364">(Oct 29 2019 at 11:12)</a>:</h4>
<p>That was a cool talk. There is a crate implementing a "compact" <code>Option</code> on <a href="http://crates.io" target="_blank" title="http://crates.io">crates.io</a>, that is, an <code>Option&lt;T&gt;</code> that's always the same size as a <code>T</code>. It currently does so by providing a trait that you can implement to tell the type how to use the niche. So that's kind of what this talk shows for <code>nullable</code>, but in OCaml it would be built into the language.</p>



<a name="179436222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Talk%20on%20data%20layout/near/179436222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Talk.20on.20data.20layout.html#179436222">(Oct 30 2019 at 14:18)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span> were you referring to the <a href="https://crates.io/crates/optional" target="_blank" title="https://crates.io/crates/optional">optional</a> crate, perhaps? Seems like a match to me</p>



<a name="179436318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Talk%20on%20data%20layout/near/179436318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Talk.20on.20data.20layout.html#179436318">(Oct 30 2019 at 14:19)</a>:</h4>
<p>though I suppose in the case of <code>optional::Optioned&lt;T&gt;</code>, the niche value has to actually <em>be</em> an instance of <code>T</code> ... which is not exactly the same as a "true niche" the way that its done internally in Rust...</p>



<a name="179436938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Talk%20on%20data%20layout/near/179436938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Talk.20on.20data.20layout.html#179436938">(Oct 30 2019 at 14:26)</a>:</h4>
<p>yes this one: <a href="https://github.com/llogiq/optional" target="_blank" title="https://github.com/llogiq/optional">https://github.com/llogiq/optional</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>